/**
 */
package de.upb.lina.lll.expressions.impl;

import de.upb.lina.lll.expressions.ExpressionsPackage;
import de.upb.lina.lll.expressions.StringValue;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>String Value</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link de.upb.lina.lll.expressions.impl.StringValueImpl#getStrValue <em>Str Value</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class StringValueImpl extends SomeValueImpl implements StringValue
{
  /**
	 * The default value of the '{@link #getStrValue() <em>Str Value</em>}' attribute.
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @see #getStrValue()
	 * @generated
	 * @ordered
	 */
  protected static final String STR_VALUE_EDEFAULT = null;

  /**
	 * The cached value of the '{@link #getStrValue() <em>Str Value</em>}' attribute.
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @see #getStrValue()
	 * @generated
	 * @ordered
	 */
  protected String strValue = STR_VALUE_EDEFAULT;

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  protected StringValueImpl()
  {
		super();
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  protected EClass eStaticClass()
  {
		return ExpressionsPackage.Literals.STRING_VALUE;
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  public String getStrValue()
  {
		return strValue;
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  public void setStrValue(String newStrValue)
  {
		String oldStrValue = strValue;
		strValue = newStrValue;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ExpressionsPackage.STRING_VALUE__STR_VALUE, oldStrValue, strValue));
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
		switch (featureID) {
			case ExpressionsPackage.STRING_VALUE__STR_VALUE:
				return getStrValue();
		}
		return super.eGet(featureID, resolve, coreType);
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  public void eSet(int featureID, Object newValue)
  {
		switch (featureID) {
			case ExpressionsPackage.STRING_VALUE__STR_VALUE:
				setStrValue((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  public void eUnset(int featureID)
  {
		switch (featureID) {
			case ExpressionsPackage.STRING_VALUE__STR_VALUE:
				setStrValue(STR_VALUE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  public boolean eIsSet(int featureID)
  {
		switch (featureID) {
			case ExpressionsPackage.STRING_VALUE__STR_VALUE:
				return STR_VALUE_EDEFAULT == null ? strValue != null : !STR_VALUE_EDEFAULT.equals(strValue);
		}
		return super.eIsSet(featureID);
	}

  /**
	 * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
	 * @generated
	 */
  @Override
  public String toString()
  {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (strValue: ");
		result.append(strValue);
		result.append(')');
		return result.toString();
	}

} //StringValueImpl
